﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MulticastTV
{
    public partial class Hidden_settings : Form
    {
        static string ie = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)";
        static string ff = "Mozilla/5.0 (Windows; U; Windows NT 5.1; sl; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)";

        public Hidden_settings()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (comboBox1.SelectedIndex == 0)
            {
                Properties.Settings.Default.UserAgent = "";
            }
            else if (comboBox1.SelectedIndex == 1)
            {
                Properties.Settings.Default.UserAgent = ff;
            }
            else if (comboBox1.SelectedIndex == 2)
            {
                Properties.Settings.Default.UserAgent = ie;
            }
            else
                Properties.Settings.Default.UserAgent = "";
            
            Properties.Settings.Default.Save();
            this.Close();
        }

        private void Hidden_settings_Load(object sender, EventArgs e)
        {
            if (Properties.Settings.Default.UserAgent == "")
            {
                comboBox1.SelectedIndex = 0;
            }
            else if (Properties.Settings.Default.UserAgent == ff)
            {
                comboBox1.SelectedIndex = 1;
            }
            else if (Properties.Settings.Default.UserAgent == ie)
            {
                comboBox1.SelectedIndex = 2;
            }
            else
                comboBox1.SelectedIndex = 0;
        }
    }
}
